import { get, put, post, del } from '@/utils/http'

// 新增
export const addRoleApi = roleData => post('/api/role/add', roleData)

// 角色列表
export const rolesApi = (page = 1, size = Number(process.env.VUE_APP_PAGESIZE)) => {
  return get(`/api/role/list?page=${page}&size=${size}`)
}

// 角色id返回对应用户记录
export const roleidToUsersApi = roleid => {
  return get(`/api/role/roleidToUsers/${roleid}`)
}

// 给指定的角色添加对应的权限节点
export const addRoleToNodesApi = (roleid, nodeData) => {
  return post(`/api/role/addRoleToNodes/${roleid}`, nodeData)
}
